package com.testdb.Userview;

import com.testdb.Dao.DaoMoneyHandle;
import com.testdb.Model.Money;
import com.testdb.Service.serviceimpl.MoneyServiceImpl;
//import main.java.com.testdb.Service.serviceimpl.MoneyServiceImpl;

import java.util.Scanner;

public class UseUi {

    public void UI() throws Exception {
       // DaoMoneyHandle daoMoneyHandle = new DaoMoneyHandle();
        MoneyServiceImpl moneyService = new MoneyServiceImpl();
        boolean flag=true;
        while (flag){
            System.out.println("--------------零钱通菜单---------------");
            System.out.println("\t\t\t1 零钱通明细");
            System.out.println("\t\t\t2 收益入账");
            System.out.println("\t\t\t3 消费");
            System.out.println("\t\t\t4 退  出");
            System.out.println("请选择（1-4）：");
            Scanner scanner = new Scanner(System.in);
            int num = scanner.nextInt();

            switch (num){
                case 1: moneyService.select();
                    break;

                case 2:
                    moneyService.insert();
                    break;
                case 3:moneyService.insert1();
                    break;
                case 4:  System.out.println("退出系统");
                    flag = false;
                    break;
                default:
                    System.out.println("请输入正确的指令");
                    break;
            }
        }
    }

}
